package com.aspose.cells;

class zaer {
   public static int a = 0;
   public static int b = 1;
   public static int c = 72;
   public static double d = 2.54D;
   public static int e = 96;
   public static int f = 65536;
   public static int g = 65535;
   public static int h = 256;
   public static int i = 409;
   private static final com.aspose.cells.b.c.a.za j = new com.aspose.cells.b.c.a.za(new String[]{"center", "distributed", "justify", "left", "right", "center-across", "fill", "general", "010", "121", "middle", "top", "bottom", "none", "single", "double", "single-accounting", "double-accounting", "gray-75", "gray-50", "gray-25", "gray-125", "gray-0625", "horz-stripe", "vert-stripe", "reverse-diag-stripe", "diag-stripe", "diag-cross", "thick-diag-cross", "thin-horz-stripe", "thin-vert-stripe", "thin-reverse-diag-stripe", "thin-diag-stripe", "thin-horz-cross", "thin-diag-cross", "Percent", "Fixed", "\"Short Date\"", "\"Medium Date\"", "\"Long Date\"", "\"Short Time\"", "\"Medium Time\"", "\"Long Time\"", "\"Currency\"", "\"General Date\"", "\"Scientific\"", "Scientific"});

   public static int a(String var0) {
      if (var0.indexOf(46) == -1 && var0.indexOf(45) == -1) {
         return com.aspose.cells.b.a.zn.a(var0) > 2.147483647E9D ? a : b;
      } else {
         return a;
      }
   }

   public static String b(String var0) {
      String var1 = com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var0, "T", " "), "Z", "");
      return var1;
   }

   public static String c(String var0) {
      String var1 = com.aspose.cells.b.a.zv.a(var0, "%20", " ");
      return com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "%26", "&"), "file:///", "");
   }

   private static String i(String var0) {
      String var1 = com.aspose.cells.b.a.zv.a(var0, "\\\\\\\\\\\\/", "/");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\\\\\\[ENG\\\\\\]", "");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\\\\\\\\ ", " ");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\\\\\\\\", "\r");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\\\\", "");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\r", "\\\\");
      var1 = com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "\"", ""), "0027", "'");
      var1 = com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "0022", "\\\""), "00A3", "");
      var1 = com.aspose.cells.b.a.zv.a(var1, "\\", "");
      return var1;
   }

   public static int d(String var0) {
      switch(j.a(var0)) {
      case 0:
         return 1;
      case 1:
         return 3;
      case 2:
         return 6;
      case 3:
         return 7;
      case 4:
         return 8;
      case 5:
         return 2;
      case 6:
         return 4;
      case 7:
         return 5;
      case 8:
         return 6;
      case 9:
         return 3;
      default:
         return 5;
      }
   }

   public static int e(String var0) {
      switch(j.a(var0)) {
      case 1:
         return 3;
      case 2:
         return 6;
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      default:
         return 5;
      case 9:
         return 3;
      case 10:
         return 1;
      case 11:
         return 9;
      case 12:
         return 0;
      }
   }

   public static String a(int var0) {
      switch(var0) {
      case 0:
      default:
         return "none";
      case 1:
      case 3:
         return "single";
      case 2:
      case 4:
         return "double-accounting";
      }
   }

   public static void a(Font var0, String var1) {
      switch(j.a(var1)) {
      case 13:
         var0.setUnderline(0);
         break;
      case 14:
         var0.setUnderline(1);
         break;
      case 15:
         var0.setUnderline(2);
         break;
      case 16:
         var0.setUnderline(3);
         break;
      case 17:
         var0.setUnderline(4);
      }

   }

   public static int f(String var0) {
      switch(j.a(var0)) {
      case 13:
         return 0;
      case 14:
         return 1;
      case 15:
         return 2;
      case 16:
         return 3;
      case 17:
         return 4;
      default:
         return 1;
      }
   }

   public static void a(String var0, Style var1) {
      String[] var2 = com.aspose.cells.b.a.zv.d(var0, ' ');
      if (var2.length == 2) {
         var1.setPattern(h(var2[1]));
      }

   }

   public static void a(String var0, Style var1, Color var2) {
      String[] var3 = com.aspose.cells.b.a.zv.d(var0, ' ');
      if (var3.length == 2) {
         var1.setPattern(h(var3[1]));
         if ("auto none".equals(var0)) {
            var1.setForegroundColor(var2);
         } else if (!"none".equals(var3[1])) {
            var1.setForegroundColor(g(var3[0]));
            var1.setBackgroundColor(var2);
         } else {
            var1.setForegroundColor(var2);
         }
      }

   }

   public static Color g(String var0) {
      if (var0 == null) {
         return Color.getEmpty();
      } else if (var0.startsWith("#")) {
         return com.aspose.cells.b.a.b.zf.a(var0);
      } else {
         String var1;
         String[] var2;
         int var5;
         if (var0.startsWith("rgb(")) {
            var1 = var0.substring(4, 4 + (var0.length() - 5));
            var2 = com.aspose.cells.b.a.zv.d(var1.trim(), ',');
            int var8 = zase.C(var2[0].trim());
            int var4 = zase.C(var2[1].trim());
            var5 = zase.C(var2[2].trim());
            return Color.fromArgb(var8, var4, var5);
         } else if (var0.startsWith("rgba(")) {
            var1 = var0.substring(5, 5 + (var0.length() - 6));
            var2 = com.aspose.cells.b.a.zv.d(var1.trim(), ',');
            double var3 = zase.B(var2[3].trim());
            var5 = (int)(var3 * (double)zase.C(var2[0].trim()) + 255.0D * (1.0D - var3));
            int var6 = (int)(var3 * (double)zase.C(var2[1].trim()) + 255.0D * (1.0D - var3));
            int var7 = (int)(var3 * (double)zase.C(var2[2].trim()) + 255.0D * (1.0D - var3));
            return Color.fromArgb(var5, var6, var7);
         } else {
            return Color.a(var0);
         }
      }
   }

   public static int h(String var0) {
      switch(j.a(var0)) {
      case 13:
         return 1;
      case 14:
      case 15:
      case 16:
      case 17:
      default:
         return 0;
      case 18:
         return 3;
      case 19:
         return 2;
      case 20:
         return 4;
      case 21:
         return 17;
      case 22:
         return 18;
      case 23:
         return 5;
      case 24:
         return 6;
      case 25:
         return 7;
      case 26:
         return 8;
      case 27:
         return 9;
      case 28:
         return 10;
      case 29:
         return 11;
      case 30:
         return 12;
      case 31:
         return 13;
      case 32:
         return 14;
      case 33:
         return 15;
      case 34:
         return 16;
      }
   }

   public static void a(Style var0, String var1) {
      String var2 = i(var1);
      switch(j.a(var1)) {
      case 35:
         var0.setNumber(10);
         break;
      case 36:
         var0.setNumber(2);
         break;
      case 37:
         var0.setNumber(14);
         break;
      case 38:
         var0.setNumber(15);
         break;
      case 39:
         var0.setNumber(31);
         break;
      case 40:
         var0.setNumber(20);
         break;
      case 41:
         var0.setNumber(18);
         break;
      case 42:
         var0.setNumber(19);
         break;
      case 43:
         var0.setNumber(43);
         break;
      case 44:
         var0.setNumber(22);
         break;
      case 45:
         var0.setNumber(48);
         break;
      case 46:
         var0.setNumber(11);
         break;
      default:
         if (var1.indexOf("Standard") != -1) {
            var0.setNumber(4);
         } else {
            var0.setCustom(var2);
         }
      }

   }
}
